#!/sbin/openrc-run

supervisor=supervise-daemon
name=miniflux
command="/usr/bin/$name"
command_args="$miniflux_opts"
command_user="miniflux:miniflux"
pidfile="/run/$name.pid"
start_stop_daemon_args="--stdout $miniflux_log_file --stderr $miniflux_log_file"

depend() {
	need net
	after firewall
}

start_pre() {
	checkpath -f -m 0644 -o ${SVCNAME}:${SVCNAME} "$miniflux_log_file"
	[ -f "/etc/conf.d/${RC_SVCNAME}" ] && checkpath --file --mode 0600 --owner root:root "/etc/conf.d/${RC_SVCNAME}"
}
